// 双向链表
import { DoublyLinkedList } from "./doubly_linked_list.js";
const linkedList = new DoublyLinkedList();
linkedList.append('aaa')
linkedList.append('bbb')
linkedList.append('ccc')
linkedList.append('ddd')

linkedList.inset(0, '000')
linkedList.inset(1, '111')
linkedList.inset(3, '333')
// console.log(linkedList);

// console.log(linkedList.get(3));
// console.log(linkedList.get(0));

// console.log(linkedList.indexOf('000'));
// console.log(linkedList.indexOf('111'));
// console.log(linkedList.indexOf('333'));

console.log(linkedList.removeAt(3));
console.log(linkedList.removeAt(0));
// console.log(linkedList);

console.log(linkedList.update(1, 'AAA'));
console.log(linkedList.update(2, 'BBB'));
// console.log(linkedList);

linkedList.remove('111')
console.log(linkedList);

console.log(linkedList.isEmpty());
console.log(linkedList.size());
